package org.example.controller;

import io.swagger.annotations.Api;
import org.example.domain.LoginVo;
import org.example.service.LoginService;
import org.example.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@Api("登录接口")
public class LoginController {
    @Autowired
    private LoginService loginService;

    @RequestMapping(value = "/login",method = RequestMethod.POST)
    public Result login(@RequestBody LoginVo loginVo) {
        return loginService.login(loginVo.getUsername(), loginVo.getPassword());
    }
    @RequestMapping(value = "/users/{id}",method = RequestMethod.PUT)
    public Result getUser(@PathVariable Long id) {
        return Result.success(111);
    }
}
